let spanArr = document.querySelectorAll(".loginbox-table .tabbtn")
let acArr = document.querySelectorAll(".loginbox-input div")
let lineBottom = document.querySelectorAll(".tabbtn span")
let conArr = document.querySelectorAll(".loginbox-con .con")
console.log(conArr);

console.log(spanArr,acArr);
spanArr.forEach(function (v,i){
    v.onclick = function(){
        spanArr.forEach(function (v1,i1){
            v1.classList.remove("active")
            conArr[i1].style.display = "none"
        })
        v.classList.add("active")
        conArr[i].style.display = "block"
        lineBottom.forEach(function (v4,i4){
            v4.style.display = "none"
        })
        v.children[0].style.display = "block"

    }
})

let inArr = document.querySelectorAll(".an")
let ittsArr = document.querySelectorAll(".itts")

let inputArr = document.querySelectorAll(".an input")
let ittpArr = document.querySelectorAll(".ittp")
let regArr = [
    /^[a-zA-Z]\w{5,11}$/,   //6-12: 字母开头,后面跟字母\数字\下划线
    /^[a-zA-Z]\w{5,11}$/    //6-12: 字母开头,后面跟字母\数字\下划线
]

inArr.forEach(function (v,i){
    ittsArr[i].style.display = "none"
    v.oninput = function (){
        if (inArr[i].children[1].value.length>0) {
            ittsArr[i].style.display = "block"
        } else {
            ittsArr[i].style.display = "none"
        }
    }
})

ittsArr.forEach(function (v2,i2){
    v2.onclick = function (){
        inArr[i2].children[1].value = ""
        ittsArr[i2].style.display = "none"
    }
})

inputArr.forEach(function (v,i){
    inputArr[i].onblur = function (){
        let bol = regArr[i].test(inputArr[i].value)
        if (bol) {
            ittpArr[i].style.display = "none"
        } else {
            ittpArr[i].style.display = "block"
        }
    }
})